class Article < ActiveRecord::Base
  belongs_to :user
  belongs_to :lough
  
  cattr_reader :per_page
  @@per_page = 10
  
  validates_presence_of :title, :lough_id, :user_id
  
  before_save :set_body_html
  
  protected
  
  def set_body_html
    write_attribute('body_html',read_attribute('body'))
  end
end
